
UPDATE LocaleStringResource Set ResourceValue = 'Encounter error during process your payment.' Where ResourceName = 'Plugins.Payments.Globalpayments.Errors.ProcessPayment'

Update LocaleStringResource Set  ResourceValue = 'Selected Time Window' where  ResourceName = 'Admin.Orders.Fields.ShippingTimeWindowsId'

Update LocaleStringResource Set  ResourceValue = 'Selected Shipping Date' where  ResourceName = 'Admin.Orders.Fields.ShipMentDate'

-- Change Age Column Type

GO
ALTER TABLE dbo.PRODUCT ALTER COLUMN AgeClass tinyint NULL ;
GO
ALTER TABLE Product ADD AgeClass1 nvarchar(50) null;
GO
UPDATE PRODUCT Set AgeClass1 = CAST(AgeClass as NVARCHAR(50))

GO

DECLARE @ConstraintName nvarchar(200)
SELECT @ConstraintName = Name 
FROM SYS.DEFAULT_CONSTRAINTS 
WHERE PARENT_OBJECT_ID = OBJECT_ID('Product') 
      AND PARENT_COLUMN_ID = 
         (SELECT column_id
          FROM sys.columns 
          WHERE NAME = N'AgeClass' 
                AND object_id = OBJECT_ID(N'Product'))
PRINT @ConstraintName
IF @ConstraintName IS NOT NULL
EXEC('ALTER TABLE Product DROP CONSTRAINT ' + @ConstraintName)
IF EXISTS (SELECT * FROM syscolumns WHERE id=object_id('Product') AND name='AgeClass')
EXEC('ALTER TABLE Product DROP COLUMN AgeClass')

GO
EXEC sp_rename 'Product.AgeClass1','AgeClass','column'


IF NOT EXISTS (SELECT * FROM dbo.LocaleStringResource WHERE ResourceName='enums.nop.core.domain.logistics.addtionalattributes.ecommerce')
INSERT INTO dbo.LocaleStringResource
        ( LanguageId ,
          ResourceName ,
          ResourceValue
        )
VALUES  ( 1 , -- LanguageId - int
          N'enums.nop.core.domain.logistics.addtionalattributes.ecommerce' , -- ResourceName - nvarchar(200)
          N'EC'  -- ResourceValue - nvarchar(max)
        )

IF NOT EXISTS(SELECT * FROM dbo.LocaleStringResource WHERE ResourceName='Admin.Orders.Fields.PickUpChangeDescription')
INSERT INTO dbo.LocaleStringResource
        ( LanguageId ,
          ResourceName ,
          ResourceValue
        )
VALUES  ( 1 , -- LanguageId - int
          N'Admin.Orders.Fields.PickUpChangeDescription' , -- ResourceName - nvarchar(200)
          N'Change Description'  -- ResourceValue - nvarchar(max)
        )

IF NOT EXISTS(SELECT * FROM dbo.LocaleStringResource WHERE ResourceName='Admin.Logistics.Common.Fields.PickUpTime')
INSERT INTO dbo.LocaleStringResource
        ( LanguageId ,
          ResourceName ,
          ResourceValue
        )
VALUES  ( 1 , -- LanguageId - int
          N'Admin.Logistics.Common.Fields.PickUpTime' , -- ResourceName - nvarchar(200)
          N'PickUp Time'  -- ResourceValue - nvarchar(max)
        )




-- New Customer Role for managing blog
	IF NOT EXISTS(SELECT 1 FROM CustomerRole WHERE SystemName = 'ContentContributor')
	BEGIN
		DECLARE @NewRoleId INT;
		INSERT INTO CustomerRole (Name, FreeShipping, TaxExempt, Active, IsSystemRole, SystemName)
		Values('Content Contributor',0,0,1,0,'ContentContributor')
		SELECT @NewRoleId = Scope_Identity()

		INSERT INTO PermissionRecord_Role_Mapping(PermissionRecord_Id, CustomerRole_Id) 
		Values(16, @NewRoleId)
	END

IF NOT EXISTS (SELECT * FROM dbo.LocaleStringResource WHERE ResourceName='Admin.Logistics.Common.Fields.ScheduledTime')
INSERT INTO dbo.LocaleStringResource
        ( LanguageId ,
          ResourceName ,
          ResourceValue
        )
VALUES  ( 1 , -- LanguageId - int
          N'Admin.Logistics.Common.Fields.ScheduledTime' , -- ResourceName - nvarchar(200)
          N'ScheduledTime'  -- ResourceValue - nvarchar(max)
        )